package com.huirui.server.controller.mini.program;

import com.huirui.server.pojo.result.Result;
import com.huirui.server.pojo.vo.ZoneVo;
import com.huirui.server.service.ZoneService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/zone")
@Slf4j
@Validated
@Tag(name = "专区管理", description = "微信小程序首页专区管理")
public class ZoneController {

    @Resource
    private ZoneService zoneService;

    @GetMapping("/list")
    @Operation(summary = "获取首页专区列表")
    public Result<List<ZoneVo>> listAvailableZoneItem() {
        List<ZoneVo> res = zoneService.listAvailableZoneItem();
        return Result.success(res);
    }
}
